package com.lswsjw.android.lib.sqlite;


/**
 * @author limtaekyu Making DB From Sql query which you entered
 */
public class DBOpenFromSql extends DBOpen
{
    private DBOpenHelper dbOpenHelper;
    
    private String mSql;
    
    public void setSql(String sql)
    {
        mSql = sql;
    }
    
    /**
     * Making DB From Sql query which you entered
     */
    public DBOpenFromSql(String sql)
    {
        mSql = sql;
    }
    
    /*
     * (non-Javadoc)
     * 
     * @see com.lswsjw.android.lib.sqlite.DBOpenAdapter#getDBOpen()
     */
    public DBOpenHelper getDBOpen()
    {
    	if(dbOpenHelper == null)
    	{
    		dbOpenHelper = new DBOpenHelper(mContext, mName, mFactory, mVersion, mPackageName) {
				
				@Override
				public void createDataBase() {
					// TODO Auto-generated method stub
					super.mDataBase.execSQL(mSql);
				}
			};
    	}
        return dbOpenHelper;
    }
}
